// ****************************************************************************
//
// Logic 3: Outside Mama Houngan's
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(37);



// Check what room the player came from and position them on the
// screen accordingly here, e.g:
 if (prev_room_no == 2) {
   position(ego,80,162);
 }

 if (prev_room_no == 4) {
   position(ego,41,122);
   }

  draw(ego);
  show.pic();
}

if (said("look")) {
  print("Cliffs rise to the north.  The forest spreads like a blanket to the south.  Mama Houngan's hut squats near a bush.");
}

if (said("look","bush")) {
   print("It's a poison berry bush.");
   }

if (said("look","poison berries")) {
   if (!has("poison berries")) {
      print("These red berries glisten with an evil light.");
      }
   else {
      show.obj(53);
      }
   }

if (said("take","poison berries") && obj.in.box(ego,70, 90, 105, 108)){
   if (poison_berries<2) {
      print("You carefully pick the ripest berries.");
      poison_berries+=1;
      }
   else {
      print("You're worried that if you keep too many berries in your pocket, they will squish all over and leave a highly toxic stain.");
      }
   }

if (ego_touching_signal_line) {  // ego in Mama's door
  new.room(4);
  }

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(7);
}

if (ego_edge_code == bottom_edge) {   // ego touching bottom edge of screen
  new.room(2);
}

if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(6);
}

return();